package top.yongyan0624.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.yongyan0624.common.dto.CountDto;
import top.yongyan0624.common.lang.Result;

/**
 * @author Yongyan
 * @description: TODO
 * @date 2021/9/22
 **/

@RestController
@RequestMapping("/index")
public class IndexController extends BaseController  {

    @GetMapping("/count")
    public Result count(){
        CountDto countDto = new CountDto(
                dynamicService.count(),
                goodsService.count(),
                goodsGroupService.count(),
                itemBorrowService.count(),
                itemFindService.count(),
                itemLostService.count(),
                noticeService.count(),
                propertyComplaintService.count(),
                propertyPayService.count(),
                propertyRepairService.count(),
                shopService.count(),
                sysMenuService.count(),
                sysRoleService.count(),
                sysUserService.count(),
                voteService.count()
        );

        return Result.success(countDto);
    }
}
